Optimal. Leaf size=61 \[ \frac{a^2 \log (\cos (c+d x))}{d}+\frac{(a+b)^2 \log (1-\sec (c+d x))}{2 d}+\frac{(a-b)^2 \log (\sec (c+d x)+1)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0996327, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {3885, 1802} \[ \frac{a^2 \log (\cos (c+d x))}{d}+\frac{(a+b)^2 \log (1-\sec (c+d x))}{2 d}+\frac{(a-b)^2 \log (\sec (c+d x)+1)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3885
Rule 1802
Rubi steps
\begin{align*} \int \cot (c+d x) (a+b \sec (c+d x))^2 \, dx &=-\frac{b^2 \operatorname{Subst}\left (\int \frac{(a+x)^2}{x \left (b^2-x^2\right )} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=-\frac{b^2 \operatorname{Subst}\left (\int \left (\frac{(a+b)^2}{2 b^2 (b-x)}+\frac{a^2}{b^2 x}-\frac{(a-b)^2}{2 b^2 (b+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{d}\\ &=\frac{a^2 \log (\cos (c+d x))}{d}+\frac{(a+b)^2 \log (1-\sec (c+d x))}{2 d}+\frac{(a-b)^2 \log (1+\sec (c+d x))}{2 d}\\ \end{align*}
Mathematica [A] time = 0.10629, size = 53, normalized size = 0.87 \[ \frac{(a+b)^2 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+(a-b)^2 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )-b^2 \log (\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.039, size = 53, normalized size = 0.9 \begin{align*}{\frac{{b}^{2}\ln \left ( \tan \left ( dx+c \right ) \right ) }{d}}+2\,{\frac{ab\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{{a}^{2}\ln \left ( \sin \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.984351, size = 84, normalized size = 1.38 \begin{align*} -\frac{2 \, b^{2} \log \left (\cos \left (d x + c\right )\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) -{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (d x + c\right ) - 1\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.873844, size = 184, normalized size = 3.02 \begin{align*} -\frac{2 \, b^{2} \log \left (-\cos \left (d x + c\right )\right ) -{\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) -{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec{\left (c + d x \right )}\right )^{2} \cot{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.38499, size = 136, normalized size = 2.23 \begin{align*} -\frac{2 \, a^{2} \log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) + 2 \, b^{2} \log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) -{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\frac{{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]